﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models.Attendance
{
    public class StaffAttendanceRule : BusinessFullEntityBase<Guid>
    {

        /// <summary>
        /// 考勤组名称
        /// </summary>
        [MaxLength(20)]
        public string Name { get; set; }

        /// <summary>
        /// 考勤人员
        /// </summary>
        public List<StaffAttendanceUser> Users { get; set; } = null;

        /// <summary>
        /// 考勤周期
        /// </summary>
        public List<StaffAttendanceCycle> CycleSettings { get; set; } = null;

        /// <summary>
        /// 开始时刻（24小时制）
        /// </summary>
        public string StartTime { get; set; } = "";

        /// <summary>
        /// 结束时刻（24小时制）
        /// </summary>
        public string EndTime { get; set; } = "";

        /// <summary>
        /// 法定节假日是否自动排休
        /// </summary>
        public bool IsExcludingLegalHolidays { get; set; } = true;

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<StaffAttendanceRule>(entity =>
            {
                entity.ToTable("Staff_Attendance_RuleSetting");
            });
        }
    }
}
